// 预订相关类型定义

export interface Booking {
  id: number;
  store_id: number;
  venue_id: number;
  venue_name: string;
  customer_name: string;
  customer_phone: string;
  customer_email?: string;
  booking_date: string;
  start_time: string;
  end_time: string;
  duration: number; // 预订时长（分钟）
  hour_price: number;
  total_amount: number;
  deposit_amount?: number;
  status: number; // 1:待确认 2:已确认 3:进行中 4:已完成 5:已取消 6:已退款
  payment_status: number; // 1:未支付 2:已支付 3:部分退款 4:全额退款
  payment_method?: string;
  booking_type: number; // 1:小时预订 2:全天预订
  special_requirements?: string;
  notes?: string;
  created_at: string;
  updated_at: string;
  created_by?: number;
  updated_by?: number;
}

export interface BookingQuery {
  page?: number;
  pageSize?: number;
  store_id?: number;
  venue_id?: number;
  date?: string;
  start_date?: string;
  end_date?: string;
  status?: number;
  payment_status?: number;
  customer_name?: string;
  customer_phone?: string;
  booking_type?: number;
}

export interface BookingListData {
  list: Booking[];
  total: number;
  page: number;
  pageSize: number;
}

export interface BookingStats {
  totalBookings: number;
  confirmedBookings: number;
  activeBookings: number;
  completedBookings: number;
  cancelledBookings: number;
  totalRevenue: number;
  paidRevenue: number;
  pendingRevenue: number;
  utilizationRate: number;
}

export interface Venue {
  id: number;
  name: string;
  store_id: number;
  venue_type: string;
  capacity: number;
  area: number;
  hour_price: number;
  day_price: number;
  status: number;
  description?: string;
  facilities?: string;
  images?: string;
  sort_order: number;
  created_at: string;
  updated_at: string;
}

export interface TimeSlot {
  start_time: string;
  end_time: string;
  available: boolean;
  booking_id?: number;
  customer_name?: string;
}

export interface BookingConflict {
  hasConflict: boolean;
  conflictBookings: Booking[];
  message?: string;
}

// 预订创建表单数据
export interface BookingFormData {
  store_id: number;
  venue_id: number;
  customer_name: string;
  customer_phone: string;
  customer_email?: string;
  booking_date: string;
  start_time: string;
  end_time: string;
  booking_type: number;
  special_requirements?: string;
  notes?: string;
}

// 预订状态枚举
export enum BookingStatus {
  PENDING = 1,      // 待确认
  CONFIRMED = 2,    // 已确认
  IN_PROGRESS = 3,  // 进行中
  COMPLETED = 4,    // 已完成
  CANCELLED = 5,    // 已取消
  REFUNDED = 6,     // 已退款
}

// 支付状态枚举
export enum PaymentStatus {
  UNPAID = 1,           // 未支付
  PAID = 2,             // 已支付
  PARTIAL_REFUND = 3,   // 部分退款
  FULL_REFUND = 4,      // 全额退款
}

// 预订类型枚举
export enum BookingType {
  HOURLY = 1,   // 小时预订
  DAILY = 2,    // 全天预订
}